module lang.d.sts.expressions.dconditionalexpression;

import lang.d.sts.expressions.dexpression;
import lang.d.visitors.dvisitor;

class DConditionalExpression: DExpression {
    private DExpression myCondition;
    private DExpression myFirstExpression;
    private DExpression mySecondExpression;

    public this(DExpression condition) {
        myCondition = condition;
        condition.setParent(this);
    }

    public void setFirst(DExpression expr) {
        myFirstExpression = expr;
        expr.setParent(this);
    }

    public void setSecond(DExpression expr) {
        mySecondExpression = expr;
        expr.setParent(this);
    }

    public DExpression getCondition() {
        return myCondition;
    }

    public DExpression getFirstExpression() {
        return myFirstExpression;
    }

    public DExpression getSecondExpression() {
        return mySecondExpression;
    }

    override public void accept(DVisitor visitor) {
        visitor.visitConditionalExpression(this);
    }
}
